<include file="Common:__head__"/>
<div class="permissions-tabs">
    <a class="role tabs-bg" href="{:U('order/order_opt_records')}">订单日志列表</a>
</div>
<div class="permissions-content">
    <div class="permissions-le">
        <div class="add-msg">
            <div class="add-form">
                <form action="" class="navbar-form form-inline" method="get" onsubmit="return false;">
                    <div class="add-form add-forma">
                        <input type="hidden" id="orderby1" value="r_id"/>
                        <input type="hidden" id="orderby2" value="DESC"/>
                        <div class="add-ipt">
                            <input placeholder="单号" type="text" id="order_sn" class="add-name" />
                            <button type="button" onclick="search_data();"></button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <div class="permissions-table">
            <table border="0" width="100%" class="msg-table">
                <thead>
                <tr>
                    <td width="10%">ID</td>
                    <td width="13%">订单编号</td>
                    <td width="10%">操作人</td>
                    <td>说明</td>
                    <td>操作时间</td>
                </tr>
                </thead>
                <tbody id="ajax_return" class="trade-setting"></tbody>
            </table>
        </div>
    </div>
    <div class="permissions-ri">
        <a href="" class="permissions-help">帮助和服务</a>
    </div>
</div>
<script type="text/javascript">
    //搜索
    $(".btn").click(function () {
        cur_page = page; //当前页面 保存为全局变量
        $.ajax({
            type : "POST",
            url:"{:U('Order/ajax_logs_list')}",
            data : {
                p :page,
                order_sn :$("#order_sn").val(),
                orderby1 :$("#orderby1").val(),
                orderby2 :$("#orderby2").val()
            },
            success: function(data){
                $("#ajax_return").html('');
                $("#ajax_return").append(data);
            }
        });
    });

    $(document).ready(function(){
        // ajax 加载商品列表
        ajax_get_table(1);
    });

    // ajax 抓取页面 form 为表单id  page 为当前第几页
    function ajax_get_table(page){
        cur_page = page; //当前页面 保存为全局变量
        $.ajax({
            type : "POST",
            url:"{:U('Order/ajax_logs_list')}",
            data : {
                p :page,
                orderby1 :$("#orderby1").val(),
                orderby2 :$("#orderby2").val()
            },
            success: function(data){
                $("#ajax_return").html('');
                $("#ajax_return").append(data);
            }
        });
    }

    // 点击排序
    function sort(field)
    {
        $("#orderby1").val(field);
        var v = $("#orderby2").val() == 'desc' ? 'asc' : 'desc';
        $("#orderby2").val(v);
        ajax_get_table(cur_page);
    }
</script>
<include file="common:__foot__"/>